<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DOM 1</title>
    <style>
        #test1 {
      width: 100px;
      height: 100px;
    }
    </style>
</head>

<body>
    示例
    <div id="test" class='red'>
        <div id="test1" class="red"></div>
    </div>
    <div id="test2" class="red">
        <div id="test3" class="red"></div>
    </div>
    <div id="test4" class="red"></div>
    <script src="dom.js"></script>
    <script src="main.js"></script>
</body>

</html>